package cn.qingyun.gis.modules.sftp.response;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SftpFileListVo implements Serializable {
    private String pwd;
    private String lpwd;
    private String path;
    private IPage<ListItem> pageInfo;

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class ListItem {
        /**
         * 文件名称
         */
        private String fileName;

        /**
         * 文件大小
         */
        private Long size;

        /**
         * 创建时间
         */
        private String atimeString;

        /**
         * 更新时间
         */
        private String mtimeString;

        /**
         * 权限
         */
        private String permissionsString;

        /**
         * 是否路径
         */
        private Boolean isDir;

        /**
         * 状态
         */
        private Integer state;

        /**
         * 操作时间
         */
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date updateTime;

        /**
         * 计数-待处理
         */
        @ApiModelProperty(value = "计数-待处理")
        @Excel(name = "计数-待处理", width = 15)
        private Integer initCount;

        /**
         * 计数-已新增
         */
        @ApiModelProperty(value = "计数-已新增")
        @Excel(name = "计数-已新增", width = 15)
        private Integer addedCount;

        /**
         * 计数-已删除
         */
        @ApiModelProperty(value = "计数-已删除")
        @Excel(name = "计数-已删除", width = 15)
        private Integer deletedCount;

        /**
         * 计数-已忽略
         */
        @ApiModelProperty(value = "计数-已忽略")
        @Excel(name = "计数-已忽略", width = 15)
        private Integer ignoredCount;
    }
}
